package com.xcdh.orm.service.ddl.impl;


import com.xcdh.commons.utils.exception.AssertUtil;
import com.xcdh.orm.ddl.DDLTable;
import com.xcdh.orm.ddl.DDLTableColumn;
import com.xcdh.orm.mapper.ddl.mysql.MysqlDDLColumnMapper;
import com.xcdh.orm.service.ddl.DDLColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * OracleDDLColumnServiceImpl
 * Created by wjg on 2023/12/2.
 */
@Service("mysqlDDLColumnService")
public class MysqlDDLColumnServiceImpl implements DDLColumnService {
    @Autowired
    private MysqlDDLColumnMapper mysqlDDLColumnMapper ;

    @Override
    public List<DDLTableColumn> getTableColumns(DDLTable ddlTable) {
        AssertUtil.blankError(ddlTable.getDataBaseName() , "数据库不可为空");
        AssertUtil.blankError(ddlTable.getTableName() , "表名不可为空");
        return mysqlDDLColumnMapper.getTableColumns(ddlTable);
    }
}
